from globalz import CHECK_INTERVAL
from globalz import IRC_SERVER
from globalz import IRC_PORT
from globalz import IRC_NICK
from globalz import IRC_CHANNEL


from parser import Parser
from tarlouzebot import Tarlouze

from daemon import createDaemon

def main():
    
    
    code = createDaemon()
    if (code != 0):
		return -1

    parser=Parser(CHECK_INTERVAL)
    bot = Tarlouze(IRC_CHANNEL, IRC_NICK, IRC_SERVER, IRC_PORT)
	
    bot.setParser (parser)
    parser.setBot (bot)
    parser.start()

    bot.monitorParser()
    bot.start()

if __name__ == "__main__":
    main()

